from info import db
from flask_script import Manager
from flask_migrate import Migrate,MigrateCommand
from info import create_app

app=create_app("pro")

# class Config(object):
#     DEBUG = True
#     SQLALCHEMY_BINDS = "mysql://root:123@127.0.0.1:3306/news_it03"
#     SQLALCHEMY_TRACK_MODIFICATIONS = False
#     REDIS_HOST = "127.0.0.1"
#     REDIS_PORT = 6379
#     SECRET_KEY = "SADQWDASAWEF"
#     SESSION_TYPE = "redis"
#     SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
#     SESSION_USE_SIGNER = True
#     SESSION_PERMANENT = 60 * 60 * 24


# app = Flask(__name__)
# app.config.from_object(Config)
# db = SQLAlchemy(app)
# redis_store = StrictRedis(host=Config.REDIS_HOST, port=Config.REDIS_PORT)
# CSRFProtect(app)
# Session(app)

manager = Manager(app)
Migrate(app,db)
manager.add_command("mysql",MigrateCommand)

@app.route("/")
def index():
    # redis_store.set("name", "laoli")
    # session["name"]="laoli"
    return "欢迎使用"


if __name__ == "__main__":
    manager.run()
